export default class TransTime
{
    public static transTime(time:number)
    {
        //9.05s
        //9.05
        //[9.05]
        //分:秒:毫秒
        //00:09:05
        //[9,50]
        let timeArry=time.toString().split('.')
        // console.log(timeSplit)
        //取出毫秒
        let miliSec=timeArry[1]
        //取出秒
        let t_sec=timeArry[0]
        let sec=(Number(t_sec)%60).toString()
        //取出分钟
        let min=(Number(t_sec)/60-0.5).toFixed(0)
        
        //当秒小于9时拼接0
        if(Number(sec)<10)
        {
            sec="0"+sec
        }
        if(Number(min)<10)
        {
            min="0"+min
        }
        //解决显示负数问题
        if((Number(t_sec)/60-0.5)<0)
        {
            min="00"
        }
        //整十的时候补一个0
        if(miliSec!=undefined){
            if(miliSec.length==1)
            {
                miliSec=miliSec+"0"
            }
        }
        else
        {
            miliSec="00"
        } 
        //拼接字符串
       let timeStr=min+":"+sec+":"+miliSec
        return timeStr
    }
}